db = require '../base/db'

Schema = db.Schema
mongoose = db.mongoose
updated_at = db.mongoose_plugins.updated_at

otcSingelBalanceSchema = new Schema({

  # 客户分类 0个人与企业 1同业
  user_type : String

  # 客户单笔业务金额与得分对照表
  singel_amount_number : Object

  # 合作业务数量与得分对照
  cor_count_number : Object

  # 各项权重
  percent : Object

  #是否投行客户
  is_investUser_number : Object

  # 是否董监高或大股东
  is_indivUser_number : Object

  # 是否新客户
  is_newUser_number : Object

  extra2 : Schema.Types.Mixed

})

otcSingelBalanceSchema.set('autoIndex', false)

otcSingelBalanceSchema.index {_id:1},{unique:true}

otcSingelBalanceSchema.index {user_type:1},{unique:true}

otcSingelBalanceSchema.plugin(updated_at,{index:true})
module.exports = mongoose.model 'otc_singel_balance', otcSingelBalanceSchema